<template>
  <div>
    <header-comm></header-comm>
    <div class="bcg">
      <div class="xw_box">
       
        <a-tabs type="card" :default-active-key="tab_xw" :activeKey="tab_xw" @change="xwback">
          <a-tab-pane :key="1" tab="新闻管理">
          </a-tab-pane>
          <a-tab-pane :key="2" tab="发布新闻">
            <fbxw></fbxw>
          </a-tab-pane>
        </a-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import headerComm from "../header-comm/header.vue";
import xwgl from "../xwgl/xwglym.vue";
import fbxw from "./fbxwym.vue";

export default {
   inject: ["reload"],
  data() {
    return {
      tab_xw: 2,
    };
  },

  methods: {
  
    xwback(key) {
      console.log(key);
      this.tab_xw = key;
      if (key == 1) {
        // this.$children.fbxwflag=true
        // this.$store.state.fbxwflag = true;
        this.$store.state.modifyval=''
        this.$store.state.tabsname=[{
        newsType: 1,
        tabdata: '国际新闻'
    }]
    this.$store.state.xiugaiflag=''
        this.$store.state.content=''

        this.$router.push("/xwgl")

      }else{
      this.reload()

      }
    },

    linkxw(val) {
      console.log(val);
      this.tab_xw = 2;
    },
    swChange(checked) {
      console.log(`a-switch to ${checked}`);
    },
   
  },
  components: {
    headerComm,
    xwgl,
    fbxw
  },
  created() {}
};
</script>

<style lang='less'>
.fbxw_tk {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 1000px;
  z-index: 999;
  .fbxw_btn {
    position: absolute;
    top: 22%;
    left: 37%;
    width: 30%;
    height: 248px;
    background: #fff;
    text-align: left;
    padding: 35px;
    button {
      margin: 10px;
    }
  }
}
.xw_box {
  position: relative;
  top: 74px;
  text-align: left;
  background: #fff;
  width: 98%;
  left: 15px;
  padding: 20px 10px;
  height: 900px;
  .sele {
    position: absolute;
    right: 20px;
    z-index: 10;
    .anticon-search {
      position: absolute;
      right: 9px;
      top: 9px;
    }
  }
  .ant-tabs{
    height: 100%;
  }
  
}
</style>
